# """
# 实例：将 1-10 中的所有偶数平方后组成新的列表
# """
#
# # 1、传统解决方案
# result = []
# for ele in range(1, 11):
#     if ele % 2 == 0:
#         result.append(ele ** 2)
# print(result)  # 打印 [4, 16, 36, 64, 100]
#
#
# # 2、使用列表推导式
# [ele**2 for ele in range(1,11) if ele%2==0]
# result = [ele ** 2 for ele in range(1, 11) if ele % 2 == 0]
# print(result)  # 打印 [4, 16, 36, 64, 100]


data = [
       {
           "id": 2,
           "parentid": 1,
           "order": 10
       },
       {
           "id": 3,
		   "parentid": 2,
           "order": 40
       }
]

# datalist = []
# for obj in data:


mylist = [obj.get("id") for obj in data]
print(mylist)